// pages/orderDetails/orderDetails.js
var app = getApp(),
  fn = app.fn;
Page({
  data: {
    orderDetails: [],
    key:''
  },

  bannerClick: function (e) {

    var id = e.currentTarget.dataset.id;
    var url = '../';



    url += 'buyCart/buyCart';



    url += '?id=' + id;
    wx.navigateTo({ url: url })
  },
  onLoad: function (options) {
    this.getInitData(options.id);
  },

  getInitData: function (callBack) {
    var that = this;
 
  
    fn.apiData({
      url: 'order.php',
      data: { back_id: callBack, act: 'back_order_detail', user_id: app.globalData.uid, },
      success: function (res) { 
        if (res.data.code == 0) {
          that.setData({
            'orderDetails': res.data.data
          }); 
          for (let key in res.data.data.list_backgoods){
            that.setData({
              key: key
            })
          }
          wx.hideToast();
        }
      }
    });
  }
})